<?php

/*
 * CopyRight  : (C)2012-2099 HaoTeam Inc.
 * Document   : route.php
 * Created on : 2020-7-24 17:03:50
 * Author     : Tiger <1192851302@qq.com>
 * Description: This is NOT a freeware, use is subject to license terms.
 *              这即使是一个免费软件,使用时也请遵守许可证条款,得到当时人书面许可.
 *              未经书面许可,不得翻版,翻版必究;版权归属 HaoTeam Inc;
 */

use think\facade\Route;

Route::any('/', function () {
    return 'hello,ThinkPHP6!';
});

//账号密码登录
Route::post('login', 'Auth/login')->name('login');
//发送手机验证码
Route::post('sms/code', 'Auth/sms_code')->name('SmsCode');
//注册新用户
Route::post('register', 'Auth/register')->name('register');
//找回密码
Route::post('reset/password', 'Auth/reset_password')->name('reset_password');
//获取系统配置
Route::get('get/config', 'Common/get_config')->name('CommonGetConfig');
//系统用户操作
Route::group(function () {
    Route::get('logout', 'Center/logout')->name('CenterLogout'); //退出登录
    Route::get('center/profile', 'Center/profile')->name('CenterProfile'); //资料
    Route::post('center/update/password', 'Center/update_password')->name('CenterUpdatePassword'); //设置密码
    Route::post('center/update', 'Center/update')->name('CenterUpdate'); //设置资料
    Route::post('center/update', 'Center/update')->name('CenterUpdate'); //设置资料
    Route::get('clear/cache', 'Common/clear_cache')->name('CommonClearCache'); //清理缓存
})->middleware(\haoteam\http\middleware\AuthTokenMiddleware::class, true);
//系统核心类 授权后使用
Route::group(function () {
    Route::post('menu/create', 'Menus/create')->name('SystemMenuCreate'); //新增菜单
    Route::post('menu/update', 'Menus/update')->name('SystemMenuUpdate'); //更新菜单
    Route::post('menu/save', 'Menus/save')->name('SystemMenuSave'); //修改菜单
    Route::post('menu/delete', 'Menus/delete')->name('SystemMenuDelete'); //删除菜单
    Route::get('menu/get', 'Menus/get')->name('SystemMenuGet'); //后台菜单
    Route::get('menu/index', 'Menus/index')->name('SystemMenuIndex'); //菜单列表
    Route::get('menu/parent/list', 'Menus/parent_list')->name('SystemMenuParentLst'); //上级菜单列表
    Route::get('menu/node/list', 'Menus/node_list')->name('SystemMenuNodeLst'); //菜单节点列表
    Route::post('member/index', 'Member/index')->name('SystemMemberIndex'); //系统用户列表
    Route::post('member/create', 'Member/create')->name('SystemMemberCreate'); //创建系统用户
    Route::post('member/update', 'Member/update')->name('SystemMemberUpdate'); //更新系统用户
    Route::post('member/delete', 'Member/delete')->name('SystemMemberDelete'); //删除系统用户

    /**
     * 当权限赋予某一个角色组时有效
     */
    Route::post('member/role', 'Member/role')->name('SystemMemberRole'); //系统角色列表
    Route::post('member/role/create', 'Member/role_create')->name('SystemMemberRoleCreate'); //创建系统角色
    Route::post('member/role/update', 'Member/role_update')->name('SystemMemberRoleUpdate'); //更新系统角色
    Route::post('member/role/delete', 'Member/role_delete')->name('SystemMemberRoleDelete'); //删除系统角色
    Route::get('member/role/auth', 'Member/role_auth')->name('SystemMemberRoleAuth'); //系统权限列表
    Route::post('member/role/write/auth', 'Member/role_write_auth')->name('SystemMemberRoleWriteAuth'); //写入角色权限节点
    /**
     * 当权限赋予每个人的时候有效
     */
    Route::get('member/auth', 'Member/auth')->name('SystemMemberAuth'); //系统权限列表
    Route::post('member/set/auth', 'Member/set_auth')->name('SystemMemberSetAuth'); //用户权限分配
    Route::post('log/index', 'Log/index')->name('SystemLogIndex'); //系统日志列表
    Route::post('log/delete', 'Log/delete')->name('SystemLogDelete'); //系统日志删除
    Route::post('log/clear', 'Log/clear')->name('SystemLogClear'); //系统日志清理
    Route::get('log/get/action', 'Log/get_action')->name('SystemLogGetAction'); //系统日志操作行为列表
    Route::post('config/tab', 'Config/tab')->name('SystemConfigTab'); //系统配置分组
    Route::get('config/get/tab', 'Config/get_tab')->name('SystemConfigGetTab'); //系统配置分组
    Route::post('config/tab/create', 'Config/tab_create')->name('SystemConfigTabCreate'); //系统配置分组添加
    Route::post('config/tab/update', 'Config/tab_update')->name('SystemConfigTabUpdate'); //系统配置分组更新
    Route::post('config/tab/delete', 'Config/tab_delete')->name('SystemConfigTabDelete'); //系统配置分组删除
    Route::get('config/get/type', 'Config/get_type')->name('SystemConfigGetType'); //系统配置表单类型
    Route::post('config/index', 'Config/index')->name('SystemConfigIndex'); //系统配置参数列表
    Route::post('config/get', 'Config/get')->name('SystemConfigGet'); //系统配置参数列表
    Route::post('config/set', 'Config/set')->name('SystemConfigSet'); //设置参数值
    Route::post('config/create', 'Config/create')->name('SystemConfigCreate'); //配置参数添加
    Route::post('config/update', 'Config/update')->name('SystemConfigUpdate'); //配置参数更新
    Route::post('config/field/update', 'Config/field_update')->name('SystemConfigFieldUpdate'); //配置参数更新
    Route::post('config/delete', 'Config/delete')->name('SystemConfigDelete'); //配置参数删除
    Route::post('file/upload/image', 'File/upload_image')->name('SystemFileUploadImage'); //上传单张图片
    Route::post('file/upload/file', 'File/upload_file')->name('SystemFileUploadFile'); //上传单个文件
    //内容管理
    Route::any('article/category/index', 'Article/category_index')->name('article_category_index');
    Route::any('article/category/parent', 'Article/category_parent')->name('article_category_parent');
    Route::post('article/category/create', 'Article/category_create')->name('article_category_create');
    Route::post('article/category/update', 'Article/category_update')->name('article_category_update');
    Route::post('article/category/save', 'Article/category_save')->name('article_category_save');
    Route::post('article/index', 'Article/index')->name('article_index');
    Route::post('article/create', 'Article/create')->name('article_create');
    Route::post('article/update', 'Article/update')->name('article_update');
    Route::post('article/delete', 'Article/delete')->name('article_delete');
    //用户管理
    Route::post('user/index', 'User/index')->name('user_index');
    Route::post('user/update', 'User/update')->name('user_update');
    Route::post('user/group', 'User/group')->name('user_group');
    //充值管理
    Route::post('recharge/index', 'Recharge/index')->name('recharge_index');
    Route::post('recharge/create', 'Recharge/create')->name('recharge_create');
    Route::post('recharge/update', 'Recharge/update')->name('recharge_update');
    Route::post('recharge/delete', 'Recharge/delete')->name('recharge_delete');
    Route::post('recharge/list', 'Recharge/list')->name('recharge_list');//用户充值记录
    //用户提现
    Route::post('withdraw/index', 'Withdraw/index')->name('withdraw_index');
    Route::post('withdraw/agree', 'Withdraw/agree')->name('withdraw_agree');
    Route::post('withdraw/refuse', 'Withdraw/refuse')->name('withdraw_refuse');
})->middleware(\haoteam\http\middleware\AuthTokenMiddleware::class, true);
